<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var sum = 0;
      var i = 1;
      while (i <= 100) {
        sum += i;
        i++;
      }
      console.log(sum);	// 输出结果：5050
    </script>
  </body>
</html>